package com.cyrene.stock.config;

import com.cyrene.stock.properties.LimiterProperties;
import com.google.common.util.concurrent.RateLimiter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:Shuna
 * @Date: 2025/11/07 21:25
 * @Description:
 */
@Configuration
public class RateLimiterConfiguration {

    @Bean
    public RateLimiter rateLimiter(LimiterProperties properties) {
        return RateLimiter.create(properties.getConcurrentNum());
    }

}
